package com.satan.juc.demo7;

/**
 * @Author: Demon
 * @Date: 2024/3/28 19:47
 * @Description:
 **/
public class Singleton {
    private static volatile Singleton instance;

    private Singleton() {

    }

    public Singleton getInstance() {
        if (instance == null) {
            synchronized (Singleton.class) {
                if (instance == null) {
                    instance=new Singleton();

                }
            }
        }
        return instance;
    }

}
